package com.xhwl.data.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xhwl.common.pojo.ResultJson;
import com.xhwl.common.pojo.cent.sdata.App;
import com.xhwl.common.query.cent.sdata.AppQuery;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @description:
 * @author:
 * @create: 2020-11-25
 **/
@RestController
public interface IAppService extends IService<App> {

    /**
     * 创建应用
     * @param app
     */
    @RequestMapping(value = "/app/create", method = RequestMethod.POST)
    void create(@RequestPart App app);

    /**
     * 更新应用
     * @param app
     */
    @RequestMapping(value = "/app/update", method = RequestMethod.POST)
    void update(@RequestPart App app);

    /**
     * 分页查询
     * @param appQuery
     * @param page
     * @return
     */
    @RequestMapping(value = "/app/page", method = RequestMethod.POST)
    Page<App> findByPage(@RequestPart("appQuery") AppQuery appQuery, @RequestPart("page") Page page);

    /**
     * 删除应用
     * @param id
     */
    @RequestMapping(value = "/app/delete", method = RequestMethod.POST)
    void delete(Integer id);

    /**
     * 根据主键查询
     * @param id
     * @return
     */
    App getAppById(Integer id);

    /**
     * 根据appId查询
     * @param appId
     * @return
     */
    @RequestMapping(value = "/app/id", method = RequestMethod.POST)
    App getByAppId(String appId);

    /**
     * 列表查询
     * @param appQuery
     * @return
     */
    @RequestMapping(value = "/app/list", method = RequestMethod.POST)
    List<App> list(@RequestPart("appQuery") AppQuery appQuery);

    /**
     * 应用类型
     * @return
     */
    ResultJson getAppType();
}
